<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html;charset=UTF-8" encoding="UTF-8">
    <h:head>

    </h:head>

    <h:body>

        <h:form id="form">
            <p:messages id="msgs" showDetail="true">
                <p:autoUpdate/>
            </p:messages>

            <p:outputLabel for="@next" value="SelectOneMenu"/>
            <p:selectOneMenu id="selectonemenu" value="#{selectOneMenu001.value}">
                <f:selectItem itemLabel="Select a driver" itemValue="" noSelectionOption="true"/>
                <f:selectItems value="#{selectOneMenu001.drivers}" var="driver" itemLabel="#{driver.name}" itemValue="#{driver.id}"/>
                <p:ajax event="itemSelect" process="@this" listener="#{selectOneMenu001.onAjaxItemSelect}"/>
            </p:selectOneMenu>

            <p:commandButton id="button" update="@form" value="Submit"/>

            <hr/>

            <p:selectOneMenu id="selectonemenu2" value="#{selectOneMenu001.value2}" label="Select a driver" alwaysDisplayLabel="#{selectOneMenu001.alwaysDisplayLabel}">
                <f:selectItem itemLabel="Select a driver" itemValue="" noSelectionOption="true"/>
                <f:selectItems value="#{selectOneMenu001.drivers}" var="driver" itemLabel="#{driver.name}" itemValue="#{driver.id}"/>
                <p:ajax event="change" process="@this" listener="#{selectOneMenu001.onAjaxChange()}"/>
            </p:selectOneMenu>

            <hr/>

            <p:selectBooleanCheckbox id="alwaysDisplayLabel" value="#{selectOneMenu001.alwaysDisplayLabel}" itemLabel="alwaysDisplayLabel">
                <p:ajax update="@form" process="@form" />
            </p:selectBooleanCheckbox>

        </h:form>

    </h:body>
</f:view>

</html>